﻿using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class CountySelectCommandHandler : IRequestHandler<CountySelectCommand, List<CountyInfo>>
    {
        private readonly ICountyService _countyService;

        public CountySelectCommandHandler(ICountyService countyService)
        {
            _countyService = countyService;
        }

        public async Task<List<CountyInfo>> Handle(CountySelectCommand request, CancellationToken cancellationToken)
        {
            return await _countyService.GetCounty(request.id);
        }
    }
}
